Programming Infinite Structures by Observations
نویسندگان
چکیده
Inductive datatypes provide mechanisms to define finite data such as finite lists and trees via constructors and allow programmers to analyze and manipulate finite data via pattern matching. In this paper, we develop a dual approach for working with infinite data structures such as streams. Infinite data inhabits coinductive datatypes which denote greatest fixpoints. Unlike finite data which is defined by constructors we define infinite data by observations. Dual to pattern matching, a tool for analyzing finite data, we develop the concept of copattern matching, which allows us to synthesize infinite data. This leads to a symmetric language design where pattern matching on finite and infinite data can be mixed. We present a core language for programming with infinite structures by observations together with its operational semantics based on (co)pattern matching and describe coverage of copatterns. Our language naturally supports both call-by-name and call-by-value interpretations and can be seamlessly integrated into existing languages like Haskell and ML. We prove type soundness for our language and sketch how copatterns open new directions for solving problems in the interaction of coinductive and dependent types.
منابع مشابه
A numerical approach for optimal control model of the convex semi-infinite programming
In this paper, convex semi-infinite programming is converted to an optimal control model of neural networks and the optimal control model is solved by iterative dynamic programming method. In final, numerical examples are provided for illustration of the purposed method.
متن کاملA new solving approach for fuzzy multi-objective programming problem in uncertainty conditions by using semi-infinite linear programing
In practice, there are many problems which decision parameters are fuzzy numbers, and some kind of this problems are formulated as either possibilitic programming or multi-objective programming methods. In this paper, we consider a multi-objective programming problem with fuzzy data in constraints and introduce a new approach for solving these problems base on a combination of the multi-objecti...
متن کاملA General Scalar-Valued Gap Function for Nonsmooth Multiobjective Semi-Infinite Programming
For a nonsmooth multiobjective mathematical programming problem governed by infinitely many constraints, we define a new gap function that generalizes the definitions of this concept in other articles. Then, we characterize the efficient, weakly efficient, and properly efficient solutions of the problem utilizing this new gap function. Our results are based on $(Phi,rho)-$invexity,...
متن کاملSolving Linear Semi-Infinite Programming Problems Using Recurrent Neural Networks
Linear semi-infinite programming problem is an important class of optimization problems which deals with infinite constraints. In this paper, to solve this problem, we combine a discretization method and a neural network method. By a simple discretization of the infinite constraints,we convert the linear semi-infinite programming problem into linear programming problem. Then, we use...
متن کاملIndexed copatterns: reasoning about infinite structures by observations
Reasoning about finite data such as lists or even lambda terms is well understood and programming languages and proof systems o↵er extensive support to inductively define such finite data. Beyond encoding such structures in a simply typed setting, indexing types allows us to enforce even more precise invariants about inductive objects; for example, we may index lists with their length to reason...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2012